home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / cmds / rawstat / RCS / rawproc.c,v < prev    next >
Encoding:
Text File  |  1990-09-24  |  5.0 KB  |  186 lines

  1. head     1.3;
  2. branch   ;
  3. access   ;
  4. symbols  ;
  5. locks    ; strict;
  6. comment  @ * @;
  7.  
  8.  
  9. 1.3
  10. date     90.09.24.14.40.31;  author douglis;  state Exp;
  11. branches ;
  12. next     1.2;
  13.  
  14. 1.2
  15. date     89.10.17.08.06.57;  author douglis;  state Exp;
  16. branches ;
  17. next     1.1;
  18.  
  19. 1.1
  20. date     89.09.11.11.46.08;  author douglis;  state Exp;
  21. branches ;
  22. next     ;
  23.  
  24.  
  25. desc
  26. @process migration statistics
  27. @
  28.  
  29.  
  30. 1.3
  31. log
  32. @changes for migration stats
  33. @
  34. text
  35. @/* 
  36.  * rawproc.c --
  37.  *
  38.  *    Print raw format PROC statistics.
  39.  *
  40.  * Copyright (C) 1986 Regents of the University of California
  41.  * All rights reserved.
  42.  */
  43.  
  44. #ifndef lint
  45. static char rcsid[] = "$Header: /sprite/src/cmds/rawstat/RCS/rawproc.c,v 1.2 89/10/17 08:06:57 douglis Exp Locker: douglis $ SPRITE (Berkeley)";
  46. #endif not lint
  47.  
  48. #include "sprite.h"
  49. #include "stdio.h"
  50. #include "sysStats.h"
  51. #include "kernel/procMigrate.h"
  52.  
  53.  
  54. /*
  55.  *----------------------------------------------------------------------
  56.  *
  57.  * PrintRawProcMigStat --
  58.  *
  59.  *    Prints proc_MigStats.
  60.  *
  61.  * Results:
  62.  *    None.
  63.  *
  64.  * Side effects:
  65.  *    None.
  66.  *
  67.  *----------------------------------------------------------------------
  68.  */
  69.  
  70. PrintRawProcMigStat()
  71. {
  72.     Proc_MigStats stats;        /* statistics buffer */
  73.     Proc_MigStats *X = &stats;
  74.     int status;
  75.  
  76.     /*
  77.      * Get a copy of the trace table.  Make sure it's zeroed in case the
  78.      * kernel provides us with a shorter (older) structure.
  79.      */
  80.  
  81.     bzero((Address) &stats, sizeof(stats));
  82.     status = Sys_Stats(SYS_PROC_MIGRATION, SYS_PROC_MIG_GET_STATS,
  83.                (Address) &stats);
  84.     if (status != SUCCESS) {
  85.     return;
  86.     }
  87.     if (stats.statsVersion != PROC_MIG_STATS_VERSION) {
  88.     return;
  89.     }
  90.  
  91.     printf("proc_MigStats\n");
  92.  
  93.  
  94.     ZeroPrint("statsVersion   %8u\n", X->statsVersion);
  95.     ZeroPrint("foreign        %8u\n", X->foreign);
  96.     ZeroPrint("remote         %8u\n", X->remote);
  97.     ZeroPrint("exports        %8u\n", X->exports);
  98.     ZeroPrint("execs          %8u\n", X->execs);
  99.     ZeroPrint("imports        %8u\n", X->imports);
  100.     ZeroPrint("errors         %8u\n", X->errors);
  101.     ZeroPrint("evictions      %8u\n", X->varStats.evictions);
  102.     ZeroPrint("evictions:squared      %8u\n", X->squared.evictions);
  103.     ZeroPrint("returns        %8u\n", X->returns);
  104.     ZeroPrint("pagesWritten   %8u\n", X->varStats.pagesWritten);
  105.     ZeroPrint("pagesWritten:squared   %8u\n", X->squared.pagesWritten);
  106.  
  107.     ZeroPrint("timeToMigrate  %8u\n", X->varStats.timeToMigrate);
  108.     ZeroPrint("timeToMigrate:squared  %8u\n", X->squared.timeToMigrate);
  109.     ZeroPrint("timeToExec     %8u\n", X->varStats.timeToExec);
  110.     ZeroPrint("timeToExec:squared     %8u\n", X->squared.timeToExec);
  111.     ZeroPrint("timeToEvict    %8u\n", X->varStats.timeToEvict);
  112.     ZeroPrint("timeToEvict:squared    %8u\n", X->squared.timeToEvict);
  113.     ZeroPrint("totalEvictTime    %8u\n", X->varStats.totalEvictTime);
  114.     ZeroPrint("totalEvictTime:squared    %8u\n", X->squared.totalEvictTime);
  115.     ZeroPrint("totalCPUTime   %8u\n", X->varStats.totalCPUTime);
  116.     ZeroPrint("totalCPUTime:squared   %8u\n", X->squared.totalCPUTime);
  117.     ZeroPrint("remoteCPUTime  %8u\n", X->varStats.remoteCPUTime);
  118.     ZeroPrint("remoteCPUTime:squared  %8u\n", X->squared.remoteCPUTime);
  119.     ZeroPrint("evictionCPUTime  %8u\n", X->varStats.evictionCPUTime);
  120.     ZeroPrint("evictionCPUTime:squared  %8u\n", X->squared.evictionCPUTime);
  121.     ZeroPrint("rpcKbytes      %8u\n", X->varStats.rpcKbytes);
  122.     ZeroPrint("rpcKbytes:squared      %8u\n", X->squared.rpcKbytes);
  123.     ZeroPrint("migrationsHome %8u\n", X->migrationsHome);
  124.     ZeroPrint("evictCalls     %8u\n", X->evictCalls);
  125.     ZeroPrint("evictsNeeded   %8u\n", X->evictsNeeded);
  126.     ZeroPrint("evictionsToUs   %8u\n", X->evictionsToUs);
  127.     ZeroPrint("processes   %8u\n", X->processes);
  128. }
  129. @
  130.  
  131.  
  132. 1.2
  133. log
  134. @print some more stats
  135. @
  136. text
  137. @d11 1
  138. a11 1
  139. static char rcsid[] = "$Header: /a/newcmds/rawstat/RCS/rawproc.c,v 1.1 89/09/11 11:46:08 douglis Exp Locker: douglis $ SPRITE (Berkeley)";
  140. d53 1
  141. a53 3
  142. #define WANT_VERSION 1
  143. #ifdef WANT_VERSION
  144.     if (stats.statsVersion != WANT_VERSION) {
  145. a55 1
  146. #endif
  147. d67 2
  148. a68 1
  149.     ZeroPrint("evictions      %8u\n", X->evictions);
  150. d70 2
  151. a71 1
  152.     ZeroPrint("pagesWritten   %8u\n", X->pagesWritten);
  153. d73 16
  154. a88 12
  155. #define TimePrint(string, time) \
  156.     ZeroPrint(string, (time).seconds * 1000000 + (time).microseconds)
  157.  
  158.     TimePrint("timeToMigrate  %8u\n", X->timeToMigrate);
  159.     TimePrint("timeToExec     %8u\n", X->timeToExec);
  160.     TimePrint("timeToEvict    %8u\n", X->timeToEvict);
  161.     X->totalCPUTime.time.seconds += X->totalCPUTime.time.microseconds / 1000000;
  162.     X->remoteCPUTime.time.seconds += X->remoteCPUTime.time.microseconds / 1000000;
  163.     ZeroPrint("totalCPUTime   %8u\n", X->totalCPUTime.time.seconds);
  164.     ZeroPrint("remoteCPUTime  %8u\n", X->remoteCPUTime.time.seconds);
  165.  
  166.     ZeroPrint("rpcKbytes      %8u\n", X->rpcKbytes);
  167. d92 2
  168. @
  169.  
  170.  
  171. 1.1
  172. log
  173. @Initial revision
  174. @
  175. text
  176. @d11 1
  177. a11 1
  178. static char rcsid[] = "$Header: /a/newcmds/rawstat/RCS/rawproc.c,v 1.2 89/06/23 16:47:43 brent Exp $ SPRITE (Berkeley)";
  179. d53 6
  180. d63 1
  181. d77 1
  182. a77 1
  183.     TimePrint("timeToExport   %8u\n", X->timeToExport);
  184. d80 4
  185. @
  186.